package com.cneport.das.client.conf;

import com.cneport.das.common.validate.FieldCheck;
import com.cneport.das.common.validate.FvEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * @Desc MQ交互
 * @Ver 1.0
 * @Author GavinZhang
 * @Company 东方物通科技有限（北京）公司
 * @Date 2022-01-07 14:10:54
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "config")
public class MqConf {
    private MqRead mqRead;
    private MqWrite mqWrite;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class MqRead {
        @FieldCheck(name = "DAS client 读取队列", type = FvEnum.STRING, isNullable = false)
        private String qName;
        private String format;
        private Long freq;
        private Integer maxCnt;
        private String feedQueue;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class MqWrite {
        @FieldCheck(name = "DAS client 读取队列", type = FvEnum.STRING, isNullable = false)
        private String qName;
        private String format;
    }
}
